:root {
  /* 主题色调 */
  --primary-color: #0C63FA;
  --primary-hover-color: #2d2e3d;
  --primary-disabled-color: #A2A6B8;
  --hover-color: #3E4052;
  --theme-color: #1C1D29;

  /* 文本颜色 */
  --text-primary: #212936;
  --text-regular: #5E6673;
  --text-secondary: #95999E;
  --text-menu: #64687A;
  --text-color-2: #64687A;
  --text-color-3: #787C8F;
  --text-color-primary: #1C1D29;
  
  /* 边框颜色 */
  --border-color: #E4E7ED;
  --el-input-hover-border-color: #0C63FA;
  --divide-color-grey-2: #A2A6B83D;
  --divide-color-grey-1: #A2A6B852;
  
  /* 背景色 */
  --bg-color: #F4F4F7;
  --bg-color-light: #FFFFFF;
  --menu-active-bg: rgba(162, 166, 184, 0.16);
  --bg-color-3: #F5F6FA;
  --bg-color-2: #F9FAFC;
  
  /* 状态颜色 */
  --success-color: #67C23A;
  --warning-color: #E6A23C;
  --danger-color: #F56C6C;
  --info-color: #909399;
  
  /* Element Plus 变量覆盖 */
  --el-color-primary: #0C63FA;
  --el-color-primary-light: #0C63FA;
  --el-color-primary-light-3: #0C63FA;
  --el-color-primary-light-5: #0C63FA;
  --el-color-primary-light-7: #0C63FA;
  --el-color-primary-light-8: #0C63FA;
  --el-color-primary-light-9: #0C63FA;
  --el-color-primary-dark-2: #16171f;
  --el-input-text-color: #1c1d29;
  
  --el-border-radius-base: 4px;
  --el-border-radius-small: 2px;
  --el-border-radius-round: 20px;
  --el-border-radius-circle: 100%;
  
  --app-background-color: #f5f7fb;
  --app-sidebar-bg: #1e293b;
  --app-header-height: 64px;
  --app-sidebar-width: 240px;
  --app-content-padding: 24px;
  
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Element Plus 全局样式覆盖 */
.el-button--primary {
  --el-button-border-color: var(--primary-color) !important;
  --el-button-hover-bg-color: var(--primary-hover-color) !important;
  --el-button-hover-border-color: var(--primary-hover-color) !important;
  --el-button-disabled-bg-color: var(--primary-disabled-color) !important;
  --el-button-disabled-border-color: var(--primary-disabled-color) !important;
}

/* 覆盖所有 el-input 的 hover 样式 */
:deep(.el-input__wrapper:hover) {
  box-shadow: 0 0 0 1px #409EFF inset !important; /* 蓝色边框 */
}

/* 覆盖所有 el-input 的 focus 样式 */
:deep(.el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #67C23A inset !important; /* 绿色边框 */
}
:deep(.el-input__wrapper.is-focus, .el-textarea__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #409EFF inset !important; /* 蓝色边框 */
}

/* 链接颜色 */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover-color);
}

/* 全局按钮样式 */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover-color);
  border-color: var(--primary-hover-color);
}

.btn-primary:disabled {
  background-color: var(--primary-disabled-color);
  border-color: var(--primary-disabled-color);
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--app-background-color);
  color: #333;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: none;
}

.card {
  padding: 2em;
}

#app {
  width: 100vw;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 卡片样式 */
.el-card {
  border: none !important;
  box-shadow: var(--card-shadow) !important;
  transition: all 0.3s ease;
}

.el-card:hover {
  box-shadow: var(--hover-shadow) !important;
}

/* 按钮样式 */
.el-button {
  font-weight: 500;
}

.el-button--primary {
  background: linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-dark-2));
}

.el-button--primary:focus,
.el-button--primary:active {
  background: linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-dark-2));
  outline: none;
  box-shadow: none;
}

/* 表单样式 */
.el-form-item__label {
  font-weight: 500;
}

.el-input__wrapper, .el-textarea__wrapper {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset !important;
}

.el-input__wrapper:hover, .el-textarea__wrapper:hover {
  box-shadow: 0 0 0 1px var(--el-color-primary-light-5) inset !important;
}

.el-input__wrapper.is-focus, .el-textarea__wrapper.is-focus {
  box-shadow: 0 0 0 1px var(--el-color-primary) inset !important;
}

/* 表格样式 */
.el-table {
  --el-table-border-color: red;
}

/* 移除表格的垂直分割线，保留水平分割线，移除外边框 */
.el-table .el-table__cell {
  border-right: none !important;
  font-weight: 400;
  color: #525466;
}

/* 移除表格四周边框 */
.el-table--border .el-table__inner-wrapper {
  border: none !important;
}
.el-table__inner-wrapper:after{
  height: 0 !important;
}

/* 移除表格右侧和底部边框 */
.el-table--border::after,
.el-table--group::after,
.el-table::before {
  display: none !important;
}

.el-table__border-left-patch,
.el-table__border-right-patch {
  display: none !important;
}

/* 保留表格头部底边框 */
.el-table__header .el-table__cell {
  border-bottom: 1px solid #EBEEF5 !important;
}

/* 移除表格和按钮点击时的边框和焦点样式 */
.el-button:focus, 
.el-button:focus-visible, 
.el-button:active,
.el-switch:focus,
.el-dropdown:focus,
.el-message-box__headerbtn:focus,
.el-upload:focus,
.el-table__row:focus,
.el-table__row td:focus,
.el-table:focus,
.el-table__cell:focus,
.el-table-column:focus,
.el-table__column:focus,
.el-table__inner-wrapper:focus,
.el-table__body:focus,
.el-table__header:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #EBEEF5 !important;
}

/* 角色列表、场景列表、剧集列表的表格背景色 */
.role-management .el-table,
.scene-management .el-table,
.episode-management .el-table,
.series-list .el-table {
  background-color: #F9FAFC !important;
}

.role-management .el-table tr,
.scene-management .el-table tr,
.episode-management .el-table tr,
.series-list .el-table tr {
  background-color: #F9FAFC !important;
}
.permission-list .el-table tr {
  background-color: #f4f4f7 !important;
}

/* 设置表头背景色保持一致 */
.role-management .el-table th.el-table__cell,
.scene-management .el-table th.el-table__cell,
.episode-management .el-table th.el-table__cell,
.series-list .el-table th.el-table__cell {
  background-color: #F9FAFC !important;
}
.permission-list .el-table th.el-table__cell {
  background-color: #f4f4f7 !important;
}

/* 页面过渡动画 */
.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: all 0.3s;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateX(30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(-30px);
}

/* 通用页面容器 */
.page-container {
  padding: var(--app-content-padding);
  background-color: var(--app-background-color);
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
}

.page-description {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* 卡片列表样式 */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  :root {
    --app-content-padding: 16px;
  }
  
  .card-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

/* 全局弹窗样式 */
.el-dialog {
  width: 680px !important;
  margin: 0 auto !important;
  position: relative !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  padding: 24px 0 0 0 !important;
}

.el-dialog__body {
  height: calc(80vh - 120px) !important;
  overflow-y: auto !important;
  padding: 24px !important;
}

.el-dialog__wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.el-dialog__header {
  padding: 0 24px !important;
  margin-right: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.el-dialog__headerbtn {
  height: 16px !important;
  width: 16px !important;
  position: relative !important;
}
.el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close {
  color: #909399 !important;
}

.el-dialog__footer {
  padding: 15px 20px 20px !important;
  box-shadow: 0px -3px 5px 0px #1F23290A;
}

/* 自定义弹窗样式 */
.el-dialog.custom-dialog {
  height: 80vh !important;
  display: flex !important;
  flex-direction: column !important;
  margin: auto !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
}

/* 移除固定高度弹窗样式，使用统一的80vh高度 */
/* .fixed-height-dialog .el-dialog {
  height: 600px !important;
} */

.custom-dialog .el-dialog__wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.custom-dialog .el-dialog__body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 24px !important;
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

.custom-dialog .el-dialog__body::-webkit-scrollbar {
  width: 8px;
}

.custom-dialog .el-dialog__body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.custom-dialog .el-dialog__body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.custom-dialog .el-dialog__body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.custom-dialog .el-dialog__header {
  padding: 20px !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

.custom-dialog .el-dialog__footer {
  padding: 15px 20px !important;
  margin-top: 0 !important;
  border-top: 1px solid #f0f0f0 !important;
}

/* 分镜弹窗样式 */
.storyboard-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.back-button {
  margin-right: 12px;
}

.txt-btn {
  color: #3644E0;
  font-size: 14px;
  cursor: pointer;
}
.txt-btn:hover {
  color: rgba(54,68,224,0.7);
  text-decoration: underline;
  text-underline-offset: 4px; /* 控制下划线与文字的距离 */
}

.episode-title {
  font-size: 16px;
  font-weight: 500;
  color: #3644E0;
}

.storyboard-progress {
  display: flex;
  align-items: center;
}

.progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-item.active .progress-circle {
  background-color: #6470FA;
  color: #fff;
}

.progress-item.active .progress-text {
  color: #6470FA;
}

.progress-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #fff;
  border: 1px solid #EBEEF5;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #787C8F;
}

.progress-text {
  font-size: 16px;
  font-weight: 500;
  color: #787C8F;
}

.progress-line {
  width: 22px;
  height: 1px;
  background-color: rgba(31, 35, 41, 0.08);
  margin: 0 12px;
}



.script-area {
  flex: 0 0 300px;
  padding: 8px;
  background-color: #EBEDF2;
  border-radius: 8px;
  margin-right: 24px;
  overflow: auto;
}

.script-title {
  font-size: 14px;
  font-weight: 500;
  color: #3644E0;
  margin-bottom: 20px;
}

.script-content {
  font-size: 14px;
  line-height: 20px;
  color: #1F2329;
  white-space: pre-wrap;
}

.storyboard-list-area {
  flex: 1;
  overflow: auto;
}

.storyboard-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.storyboard-list-title {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
}

.storyboard-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storyboard-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.storyboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.storyboard-card-title {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
}

.form-item {
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: #606266;
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.scene-description {
  font-size: 14px;
  line-height: 20px;
  color: #3644E0;
  margin-bottom: 12px;
}

.scene-preview {
  margin-bottom: 12px;
}

.scene-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
}

.divider {
  width: 1px;
  height: 14px;
  background-color: #EBEEF5;
  margin: 0 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.polling-status {
  text-align: center;
}

.loading-icon {
  font-size: 24px;
  color: #3644E0;
  margin-bottom: 12px;
}

.loading-text {
  font-size: 14px;
  color: #606266;
  margin-bottom: 12px;
}

.polling-progress {
  width: 200px;
  height: 6px;
  background-color: #EBEEF5;
  border-radius: 3px;
  overflow: hidden;
}

.polling-bar {
  height: 100%;
  background-color: #3644E0;
  transition: width 0.3s;
}

/* 场景选择弹窗样式 */
.scene-dialog .el-dialog__body {
  padding: 24px;
}

.scene-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.scene-item {
  border: 1px solid #EBEEF5;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.scene-item:hover {
  border-color: #3644E0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.scene-item.active {
  border-color: #3644E0;
  background-color: rgba(54, 68, 224, 0.05);
}

.scene-item-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}

.scene-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #303133;
  margin-bottom: 4px;
}

.scene-item-desc {
  font-size: 12px;
  color: #909399;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.confirm-delete-btn-class{
  background: #1C1D29 !important;
  background-color: #1C1D29 !important;
  border: 0 !important;
  border-radius: 8px !important;
}
.cancel-delete-btn-class {
  background: #fff !important;
  color: #1F2329 !important;
  border: 1px solid #F0F2F5 !important;
  border-color: #F0F2F5 !important;
  border-radius: 8px !important;
}
.cancel-delete-btn-class:hover {
  border: 1px solid #F0F2F5 !important;
  border-color: #F0F2F5 !important;
}
.custom-tooltip {
  max-width: 400px;
}

.delete-confirm-dialog {
  background: #f4f4f7 !important;
  border-radius: 16px;
}
.el-button.custom-operate-btn {
  padding:0 !important;
  width: 80px;
  border-radius: 12px;
  font-size: 12px;
  height: 32px;
}

/* 修改所有对话框的圆角为12px */
.el-dialog {
  border-radius: 12px !important;
  overflow: hidden;
  background: #f4f4f7 !important;
}

.save-el-button {
  padding: 17px 29px !important;
}

.el-dialog__header {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.el-dialog__footer {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(144, 147, 153, 0.3);
  border-radius: 6px;
  visibility: hidden; /* 默认隐藏 */
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

/* 滚动时显示滚动条 */
:hover::-webkit-scrollbar-thumb,
:focus::-webkit-scrollbar-thumb,
:active::-webkit-scrollbar-thumb,
.scrolling::-webkit-scrollbar-thumb {
  visibility: visible;
}

/* 悬停在滚动条上时保持可见 */
::-webkit-scrollbar-thumb:hover {
  visibility: visible;
  background-color: rgba(144, 147, 153, 0.5);
}

/* 确保滚动时内容不会抖动 */
html {
  overflow-y: scroll;
}

/* 为Element Plus组件添加自定义滚动条样式 */
.el-table__body-wrapper,
.el-scrollbar__wrap,
.el-select-dropdown__wrap,
.el-cascader-menu__wrap,
.el-dialog__body,
.el-drawer__body {
  scrollbar-width: thin;
}

/* 自定义滚动条容器类 */
.custom-scrollbar {
  scrollbar-width: thin;
  margin-right: 8px !important;
  position: relative;
}